<template>
  <div>
    <div class="f-settings-item">
      <span class="title">固定头</span>
      <el-switch v-model="fixedHeader" />
    </div>
    <div class="f-settings-item">
      <span class="title">侧边栏Logo</span>
      <el-switch v-model="sidebarLogo"/>
    </div>
    <div class="f-settings-item">
      <span class="title">设置项2</span>
      <el-switch  />
    </div>
  </div>
</template>
<script>
import {mapGetters} from 'vuex'

export default {
  name: 'FSettings',
  data () {
    return {
    }
  },
  computed: {
    ...mapGetters([
      'setting_fixedHeader',
      'setting_sidebarLogo'
    ]),
    fixedHeader: {
      get () {
        return this.setting_fixedHeader
      },
      set (val) {
        this.$store.dispatch('changeSetting', {
          key: 'fixedHeader',
          value: val
        })
      }
    },
    sidebarLogo: {
      get () {
        return this.setting_sidebarLogo
      },
      set (val) {
        this.$store.dispatch('changeSetting', {
          key: 'sidebarLogo',
          value: val
        })
      }
    }
  }
}
</script>
<style scoped>
  .f-settings-item{
    padding: 10px 20px;
  }
  .f-settings-item .title{
    float: left;
    margin-left: 30px;
    width: 100px;
    text-align: left;
  }
</style>
